﻿using System.Threading.Tasks;

namespace Sidvall.AuthorizationManager.Data.Entity.Model
{
    public sealed partial class StorageManager : global::Sidvall.Data.Entity.StorageManagerDbContextBase<StorageManager, global::Sidvall.AuthorizationManager.Data.Entity.Model.AuthorizationManagerEntities>, global::Sidvall.Data.IStorageManager
    {
        #region DeleteItemsAsync

        public async Task DeleteItemsAsync(global::Sidvall.Business.IDataPortalContext dataPortalContext)
        {
            switch (dataPortalContext.Resource)
            {
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScope:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeManager.DeleteItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, global::Sidvall.Data.DeleteCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeExport:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeExportManager.DeleteItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, global::Sidvall.Data.DeleteCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeExportField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceAction:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionManager.DeleteItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, global::Sidvall.Data.DeleteCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceActionField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceActionClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionClaimManager.DeleteItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, global::Sidvall.Data.DeleteCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceActionClaimField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItem:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemManager.DeleteItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, global::Sidvall.Data.DeleteCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceItemField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItemClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemClaimManager.DeleteItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, global::Sidvall.Data.DeleteCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceItemClaimField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeUser:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeUserManager.DeleteItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, global::Sidvall.Data.DeleteCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeUserField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                default:
                    break;
            }
        }

        #endregion
        #region ExecuteAsync

        public async Task ExecuteAsync(global::Sidvall.Business.DataPortalContext<global::Sidvall.Data.CommandCriteria, global::Sidvall.Data.CommandCriteria> dataPortalContext)
        {
            switch (dataPortalContext.Resource)
            {
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScope:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeManager.ExecuteAsync(this.ObjectContext, dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeExport:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeExportManager.ExecuteAsync(this.ObjectContext, dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceAction:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionManager.ExecuteAsync(this.ObjectContext, dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceActionClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionClaimManager.ExecuteAsync(this.ObjectContext, dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItem:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemManager.ExecuteAsync(this.ObjectContext, dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItemClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemClaimManager.ExecuteAsync(this.ObjectContext, dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeUser:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeUserManager.ExecuteAsync(this.ObjectContext, dataPortalContext).ConfigureAwait(false);
                    break;
                default:
                    break;
            }
        }

        #endregion
        #region GetItemAsync

        public async Task GetItemAsync(global::Sidvall.Business.IDataPortalContext dataPortalContext)
        {
            switch (dataPortalContext.Resource)
            {
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScope:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeManager.GetItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScope, global::Sidvall.Data.FetchCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeExport:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeExportManager.GetItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeExport, global::Sidvall.Data.FetchCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeExportField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeExportRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceAction:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionManager.GetItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction, global::Sidvall.Data.FetchCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceActionField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeResourceActionRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceActionClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionClaimManager.GetItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceActionClaim, global::Sidvall.Data.FetchCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceActionClaimField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeResourceActionClaimRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItem:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemManager.GetItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItem, global::Sidvall.Data.FetchCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceItemField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeResourceItemRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItemClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemClaimManager.GetItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItemClaim, global::Sidvall.Data.FetchCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceItemClaimField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeResourceItemClaimRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeUser:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeUserManager.GetItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser, global::Sidvall.Data.FetchCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeUserField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeUserRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                default:
                    break;
            }
        }

        #endregion
        #region GetItemCountAsync

        public async Task GetItemCountAsync(global::Sidvall.Business.IDataPortalContext dataPortalContext)
        {
            switch (dataPortalContext.Resource)
            {
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScope:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeManager.GetItemCountAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<long, global::Sidvall.Data.FetchCountCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeExport:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeExportManager.GetItemCountAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<long, global::Sidvall.Data.FetchCountCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeExportField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceAction:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionManager.GetItemCountAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<long, global::Sidvall.Data.FetchCountCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceActionField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceActionClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionClaimManager.GetItemCountAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<long, global::Sidvall.Data.FetchCountCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceActionClaimField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItem:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemManager.GetItemCountAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<long, global::Sidvall.Data.FetchCountCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceItemField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItemClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemClaimManager.GetItemCountAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<long, global::Sidvall.Data.FetchCountCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceItemClaimField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeUser:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeUserManager.GetItemCountAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<long, global::Sidvall.Data.FetchCountCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeUserField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                default:
                    break;
            }
        }

        #endregion
        #region GetItemsAsync

        public async Task GetItemsAsync(global::Sidvall.Business.IDataPortalContext dataPortalContext)
        {
            switch (dataPortalContext.Resource)
            {
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScope:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeManager.GetItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScope, global::Sidvall.Data.FetchListCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeExport:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeExportManager.GetItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeExport, global::Sidvall.Data.FetchListCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeExportField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeExportRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceAction:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionManager.GetItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction, global::Sidvall.Data.FetchListCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceActionField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeResourceActionRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceActionClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionClaimManager.GetItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceActionClaim, global::Sidvall.Data.FetchListCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceActionClaimField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeResourceActionClaimRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItem:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemManager.GetItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItem, global::Sidvall.Data.FetchListCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceItemField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeResourceItemRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItemClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemClaimManager.GetItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItemClaim, global::Sidvall.Data.FetchListCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceItemClaimField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeResourceItemClaimRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeUser:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeUserManager.GetItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser, global::Sidvall.Data.FetchListCriteria<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeUserField, global::Sidvall.AuthorizationManager.Data.Relations.AuthorizationScopeUserRelation>>)dataPortalContext).ConfigureAwait(false);
                    break;
                default:
                    break;
            }
        }

        #endregion
        #region NewItemAsync

        public async Task NewItemAsync(global::Sidvall.Business.IDataPortalContext dataPortalContext)
        {
            switch (dataPortalContext.Resource)
            {
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScope:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeManager.NewItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScope, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeExport:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeExportManager.NewItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeExport, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceAction:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionManager.NewItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceActionClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionClaimManager.NewItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceActionClaim, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItem:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemManager.NewItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItem, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItemClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemClaimManager.NewItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItemClaim, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeUser:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeUserManager.NewItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                default:
                    break;
            }
        }

        #endregion
        #region NewItemsAsync

        public async Task NewItemsAsync(global::Sidvall.Business.IDataPortalContext dataPortalContext)
        {
            switch (dataPortalContext.Resource)
            {
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScope:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeManager.NewItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScope, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeExport:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeExportManager.NewItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeExport, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceAction:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionManager.NewItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceActionClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionClaimManager.NewItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceActionClaim, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItem:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemManager.NewItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItem, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItemClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemClaimManager.NewItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItemClaim, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeUser:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeUserManager.NewItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser, global::Sidvall.Data.CreateCriteria>)dataPortalContext).ConfigureAwait(false);
                    break;
                default:
                    break;
            }
        }

        #endregion
        #region SaveItemAsync

        public async Task SaveItemAsync(global::Sidvall.Business.IDataPortalContext dataPortalContext)
        {
            switch (dataPortalContext.Resource)
            {
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScope:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeManager.SaveItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScope, Sidvall.Data.SaveContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScope>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeExport:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeExportManager.SaveItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeExport, Sidvall.Data.SaveContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeExport>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceAction:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionManager.SaveItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction, Sidvall.Data.SaveContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceActionClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionClaimManager.SaveItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceActionClaim, Sidvall.Data.SaveContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceActionClaim>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItem:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemManager.SaveItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItem, Sidvall.Data.SaveContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItem>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItemClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemClaimManager.SaveItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItemClaim, Sidvall.Data.SaveContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItemClaim>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeUser:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeUserManager.SaveItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser, Sidvall.Data.SaveContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser>>)dataPortalContext).ConfigureAwait(false);
                    break;
                default:
                    break;
            }
        }

        #endregion
        #region SaveItemsAsync

        public async Task SaveItemsAsync(global::Sidvall.Business.IDataPortalContext dataPortalContext)
        {
            switch (dataPortalContext.Resource)
            {
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScope:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeManager.SaveItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScope, Sidvall.Data.SaveContext<Sidvall.Data.IDataRowProvider<global::Sidvall.AuthorizationManager.Data.IAuthorizationScope>>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeExport:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeExportManager.SaveItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeExport, Sidvall.Data.SaveContext<Sidvall.Data.IDataRowProvider<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeExport>>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceAction:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionManager.SaveItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction, Sidvall.Data.SaveContext<Sidvall.Data.IDataRowProvider<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction>>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceActionClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionClaimManager.SaveItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceActionClaim, Sidvall.Data.SaveContext<Sidvall.Data.IDataRowProvider<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceActionClaim>>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItem:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemManager.SaveItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItem, Sidvall.Data.SaveContext<Sidvall.Data.IDataRowProvider<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItem>>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItemClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemClaimManager.SaveItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItemClaim, Sidvall.Data.SaveContext<Sidvall.Data.IDataRowProvider<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceItemClaim>>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeUser:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeUserManager.SaveItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser, Sidvall.Data.SaveContext<Sidvall.Data.IDataRowProvider<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser>>>)dataPortalContext).ConfigureAwait(false);
                    break;
                default:
                    break;
            }
        }

        #endregion
        #region UpdateItemAsync

        public async Task UpdateItemAsync(global::Sidvall.Business.IDataPortalContext dataPortalContext)
        {
            switch (dataPortalContext.Resource)
            {
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScope:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeManager.UpdateItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<bool, Sidvall.Data.UpdateItemContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeExport:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeExportManager.UpdateItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<bool, Sidvall.Data.UpdateItemContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeExportField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceAction:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionManager.UpdateItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<bool, Sidvall.Data.UpdateItemContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceActionField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceActionClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionClaimManager.UpdateItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<bool, Sidvall.Data.UpdateItemContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceActionClaimField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItem:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemManager.UpdateItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<bool, Sidvall.Data.UpdateItemContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceItemField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItemClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemClaimManager.UpdateItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<bool, Sidvall.Data.UpdateItemContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceItemClaimField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeUser:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeUserManager.UpdateItemAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<bool, Sidvall.Data.UpdateItemContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeUserField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                default:
                    break;
            }
        }

        #endregion
        #region UpdateItemsAsync

        public async Task UpdateItemsAsync(global::Sidvall.Business.IDataPortalContext dataPortalContext)
        {
            switch (dataPortalContext.Resource)
            {
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScope:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeManager.UpdateItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, Sidvall.Data.UpdateItemsContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeExport:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeExportManager.UpdateItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, Sidvall.Data.UpdateItemsContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeExportField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceAction:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionManager.UpdateItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, Sidvall.Data.UpdateItemsContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceActionField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceActionClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceActionClaimManager.UpdateItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, Sidvall.Data.UpdateItemsContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceActionClaimField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItem:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemManager.UpdateItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, Sidvall.Data.UpdateItemsContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceItemField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeResourceItemClaim:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeResourceItemClaimManager.UpdateItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, Sidvall.Data.UpdateItemsContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeResourceItemClaimField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                case global::Sidvall.AuthorizationManager.Data.Model.DomainObjects.AuthorizationScopeUser:
                    await Sidvall.AuthorizationManager.Data.Entity.Model.StorageManagers.AuthorizationScopeUserManager.UpdateItemsAsync(this.ObjectContext, (global::Sidvall.Business.DataPortalContext<int, Sidvall.Data.UpdateItemsContext<global::Sidvall.AuthorizationManager.Data.Fields.AuthorizationScopeUserField>>)dataPortalContext).ConfigureAwait(false);
                    break;
                default:
                    break;
            }
        }

        #endregion
        public static global::Sidvall.AuthorizationManager.Data.Entity.Model.StorageManager GetStorageManager()
        {
            return Sidvall.Data.Entity.StorageManagerDbContextBase<StorageManager, global::Sidvall.AuthorizationManager.Data.Entity.Model.AuthorizationManagerEntities>.GetManager();
        }
        public static global::Sidvall.AuthorizationManager.Data.Entity.Model.StorageManager GetStorageManager(string nameOrConnectionString)
        {
            return Sidvall.Data.Entity.StorageManagerDbContextBase<StorageManager, global::Sidvall.AuthorizationManager.Data.Entity.Model.AuthorizationManagerEntities>.GetManager(nameOrConnectionString);
        }
        private StorageManager()
        {
        }
    }
}